<template>
  <scrolla :class-option="optionSwitch2" class="seamless-warp3">
    <span slot="left-switch" class="left-arrow"></span>
    <span slot="right-switch" class="right-arrow"></span>
    <ul class="item">
      <li v-for="(item, index) in listData" :key="item + index">
        <img :src="item" alt="" srcset="" width="50" height="50" />
      </li>
    </ul>
  </scrolla>
</template>
<style lang="scss" scoped>
.seamless-warp3 {
  overflow: hidden;
  height: 140px;
  width: 140px * 4;
  margin: 0 auto;
  .left-arrow,
  .right-arrow {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #00a0e9;
    cursor: pointer;
    &:hover {
      background-color: #0f39fa;
    }
    &::before {
      position: absolute;
      content: "";
      width: 16px;
      height: 16px;
      top: 12px;
      left: 15px;
      border: 2px solid #fff;
    }
  }
  .left-arrow::before {
    border-right: 0;
    border-bottom: 0;
    transform: rotate(-45deg);
  }
  .right-arrow::before {
    border-left: 0;
    border-top: 0;
    left: 9px;
    transform: rotate(-45deg);
  }
  ul.item {
    width: 140px * 8;
    li {
      list-style-type: none;
      float: left;
      width: 120px;
      height: 120px;
      margin: 10px;
      line-height: 120px;
      // background-color: #999;
      // color: #fff;
      // text-align: center;
      // font-size: 30px;
    }
  }
}
</style>
<script>
import scrolla from "vue-seamless-scroll"
export default {
  components: {
    scrolla
  },
  data() {
    return {
      listData: [
        "/static/img/erro.png",
        "/static/img/erro.png",
        "/static/img/erro.png",
        "/static/img/erro.png",
        "/static/img/erro.png"
      ]
    }
  },
  computed: {
    optionSwitch2() {
      return {
        autoPlay: false,
        switchSingleStep: 100,
        switchDelay: 200,
        navigation: true,
        direction: 2,
        limitMoveNum: 2
      }
    }
  }
}
</script>
